<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta name="description" content="<?php echo ($site_conf["setting_site_title"]); ?>">
    <meta name="author" content="CDCT TEAM.">
    <title>系统后台－敏感词管理</title>
    
    <link rel="stylesheet" href="/static/bootstrap/css/bootstrap.min.css">

    <link type="text/css" rel="stylesheet" href="/static/common/style/reset.css" />
    <link type="text/css" rel="stylesheet" href="/static/admin/style/basic.css"/>
    <style type="text/css">html,body{height:100%;}html{height:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}</style>
    
    <style>
        .del_words{ padding: 5px 8px; font-size: 12px; font-weight: normal; margin-right: 5px; cursor: pointer;}
    </style>

</head>
<body>

    <div class="wrap-page">
        <div id="pageConfigSite" class="page-content">
            <?php if(!empty($dataMenus)): ?><div class="tabs">
    <div class="tabs-title clearfix">
        <ul>
            <?php if(is_array($dataMenus)): foreach($dataMenus as $key=>$vo): ?><li <?php if($action_name == $vo['action_name']): ?>class="current"<?php endif; ?>><a href="<?php echo U('backend/'.$vo['module_name'].'/'.$vo['action_name'],array('menuid' => $menu_id)); ?>"><?php echo ($vo["name"]); ?></a></li><?php endforeach; endif; ?>
        </ul>
    </div>
</div><?php endif; ?>
            <form class="form default-style" role="form" id="setting_site_form" action="<?php echo u('backend/settings/unabledwords');?>" method="post">
                <div id="boxConfigSite" class="box">
                    <div class="box-content">

                        <dl class="clearfix">
                            <dt><label>敏感词：</label></dt>
                            <dd>

                                <div class="item-field clearfix">
                                    <input  type="text" class="textfield" name="words" id="words"
                                            placeholder="请输入敏感词" autocomplete="off"/>
                                    <button type="button" class="save button button-blue">保存</button>
                                </div>
                            </dd>
                        </dl>

                        <dl class="clearfix">
                            <div class="panel panel-info" style="width: 97%; margin-top: 20px; margin-left: 30px;">

                                <div class="panel-body">
                                    <?php if(!empty($list)): if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><span class="del_words label <?php echo ($class_list[rand(0,5)]); ?>" data-id="<?php echo ($vo["id"]); ?>" title="点击删除"><?php echo ($vo["words"]); ?></span><?php endforeach; endif; else: echo "" ;endif; endif; ?>
                                </div>
                            </div>
                        </dl>

                    </div>
                </div>

            </form>
        </div>
    </div>

<script type="text/javascript" src="/static/common/script/jquery-1.11.1.min.js"></script>
<script src="/static/layer/layer.js" type="text/javascript"></script>
<script type="text/javascript" src="/static/admin/script/common.js"></script>
<script type="text/javascript" src="/static/admin/script/listTable.js"></script>

    <script>
        $(document).ready(function(){

            $('.save').click(function(){
                //数据验证
                $.ajax({
                    type: "POST",
                    url: $('.form').attr('action'),
                    data: $('.form').serialize(),
                    dataType: "json",
                    success:function(data){
                        if(data.status)
                        {
                            layer.msg(data.msg,{icon: 1,time:2000, shade: [0.1, '#ccc']},function(){
                                window.location.reload();
                            });
                        } else {
                            layer.msg(data.msg,{icon: 2,time:2000, shade: [0.1, '#ccc']})
                        }
                    }
                });
                return false;
            });

            $('.del_words').on('click',function(){
                var id  = $(this).attr('data-id');
                var url = "<?php echo U('backend/settings/del_words');?>";
                layer.confirm('确定删除？', function(){
                    $.post(url,{id:id},function(res){
                        if(res.status)
                        {
                            layer.msg(res.msg,{icon:1, time:2000}, function(){
                                window.location.reload();
                            })
                        }
                    },'json')
                });
            })
        });
    </script>

</body>
</html>